<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>财务报表管理</title>
  <%@include file="/WEB-INF/base.jspf"%>
  <style type="text/css">
  	.body_wrapper{
  		height: 100%;
  		width: 100%;
  		box-sizing: border-box;
  		padding: 0px 20px;
  		
  	}
	.modal-dialog {
		max-width: 1000px;
	}  	
  	.wrapper_buttons{
  		position: relative;
  	}
  	.shezhileiContent{
  		width: 160px;
  		height: 150px;
  		border: 1px solid  #9c8f8f;
  		border-radius: 5px;
  		box-sizing: border-box;
  		padding: 13px;
  		position: absolute;
  		right: 0px;
  		top: 36px;
  		z-index: 999;
  		background: #fff;
  		
  		
  	}
  	.shezhileiContent li {
  		margin-bottom:10px ;
  	}
  	.shezhileiContent li span{
  		margin-left: 6px;
  	}
  	.wrapper_buttons input{
  		height: 32px;
  		width: 174px;
  		margin-left: 10px;
  	}
  	.wrapper_buttons button{
  		margin-left: 10px;
  	}
  	
#table_id_example_paginate{
 margin-right:100px;
}
.class-input-pageNumber{
    
	width:40px;
	height:23px;
	position: absolute;
	right:65px;
	top:12px;
}
.class-span-searchBtn{
	height:24px;
	width:36px;
	font-size:14px;
	text-algin:center;
	line-height:25px;
	padding:0!important;
	position: absolute;
	right:29px;
	top:12px;
}
.dataTables_length{
	margin-top:12px;
	margin-left:50px;
}
.tableSearch{
    position: relative;
}
table th,table tr,table td {
text-align: center;
vertical-align:middle;
}
  	
  </style>
</head>
<body>
	<div class="body_wrapper">
		<div class="wrapper_buttons" style="display: flex; margin-top: 20px;">
			<input type="text" name="" id="obj-date1" placeholder="开始时间" /> <input
				type="text" name="" id="obj-userName" class="form-control" placeholder="单用户查询" />
			<button type="button" class="layui-btn layui-btn-radius"
				id="btn-search-find">查询</button>
			<button type="button" class="layui-btn layui-btn-radius"
				id="btn-reset-close">重置</button>
			<br />
		</div>
		<div class="wrapper_buttons"
			style="display: flex; margin-bottom: 20px;">
			<input type="text" name="" id="obj-date2" placeholder="结束时间" />
		</div>
		<table id="table_id_example" class="class-tableDataTable class-table-needClick display table table-striped table-bordered table-hover">
					<thead>
						<tr>
							<th>用户账号</th>
							<th>用户类型</th>
							<th>存款总计</th>
							<th>存款次数</th>
							<th>提款总计</th>
							<th>提款次数</th>
							<th>人工加款</th>
							<th>人工扣款 </th>
							<th>反水总计</th>
							<th>返点总计</th>
							<th>存款赠送</th>
							<th>注册赠送</th>
						</tr>
					</thead>
					<tbody>
					</tbody>
		</table>
	</div>
		<p style="margin-top:30px;"></p>
		<p style="margin-left: 42px; color: blue;">备注：统计比较消耗系统性能，统计结果将缓存1分钟;</p>
<script>
layui.use('laydate', function() {
	var laydate = layui.laydate;
	laydate.render({
		elem : '#obj-date1',
		 value:new Date(),
	    max: new Date()+1
	});
	laydate.render({
		elem : '#obj-date2',
		 value:new Date(),
	    max: new Date()+1
	});
});
	  $(function(){
 		 dataTable01(); 
 		insertSearchBtn();
	 	 $("#btn-search-find").on("click",searchFindData);
		 $("#btn-reset-close").on("click",resetCloseData);
	});  

 	function dataTable01(){
			$("#table_id_example").DataTable({
		      // "bPaginate": true,
		      "bLengthChange": true,      
		      "bSort": false,
		      // "bInfo": true,
		      "bAutoWidth": false,
//		         "bServerSide":true,
		      'aLengthMenu':[5, 10, 20],
		       "searching": true, 
		       "dom": "t<'tableinfo'i<'tableSearch'p>l>",
//		    "searching": true,l
		       "language": {//语言设置  
		            "lengthMenu": "每页显示 _MENU_ 条记录",     
		            "zeroRecords": "没有检索到数据",     
		            "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录",     
		            "info": "没有数据",     
		            "oPaginate": {     
		                "sFirst": "首页",     
		                "sPrevious": "前一页",     
		                "sNext": "后一页",     
		                "sLast": "尾页"    
		          	},
		            "search":"",
		            "searchPlaceholder": "请输入关键字",
		            "infoFiltered":   "(从  _MAX_ 记录中搜索出结果)",
		            "infoEmpty":      "没有找到匹配的信息",
		         },
		        "columns": [
		                     { "data": "name" },
		                     { "data": "user_type"},
		                     { "data": "zxchongzhi" },
		                     { "data": "ckcishu" },
		                     { "data": "zxtikuan" },
		                     { "data": "tkcishu" },
		                     { "data": "rgjiakuan" },
		                     { "data": "rgkoukuan" },
		                     { "data": "mrfanshui" },
		                     { "data": "dlfandian" },
		                     { "data": "czzengsong" },
		                     { "data": "zczengsong" }, 
		                 ],	  
			  		  "ajax": {
			    	  	  "type": 'post',
			    	       "url":"/bbgl/findAllFinanceReport.do", 
				    	   "data": function ( d ) {
			    	        d.startTime = $('#obj-date1').val();
			    	        d.endTime = $('#obj-date2').val();
			    	        d.userName = $('#obj-userName').val();
			           } 
			      } 
		    })
		} 
	
 	  function searchFindData(event){
		  var table = $("#table_id_example").DataTable();
       		table.ajax.reload();
	 }
		 
		function resetCloseData(event){
			var table = $("#table_id_example").DataTable();
			$('#obj-date1').val("");
  	        $('#obj-date2').val("");
  	        $('#obj-userName').val("");
       		table.ajax.reload();
		 }  
		
</script> 
</body>
</html>